// TOWN SCRIPT
//    Town 17: Corinth (after winning)

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documentation. States you write
// yourself should be numbered from 10-100.

// flags:
//  (3, x flags from previous incarnation of town)
// 3, 1 = training on (true)/off (false)
//  (new to new version of town)
// 17, 0 = entry message flag
// 17, 3 = shop message (guards place)
// 17, 4 = guards room msg
// 17, 5 = Paul conversation flag

begintownscript;

variables;

short choice, i, al, il;

body;

beginstate INIT_STATE;
	turn_off_training(TRUE);
	set_crime_tolerance(3);

	set_name(6, "Paul");
	set_char_dialogue_pic(6, 540, 0);
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
	if (get_flag(17, 0) == FALSE) {
		set_flag(17, 0, TRUE);
		reset_dialog();
		add_dialog_str(0, "The small town of Corinth is looking a lot better now.", 0);
		add_dialog_str(1, "With the freeing of The Wilderness, the town can come back to life.", 0);
		add_dialog_str(2, "The Wilderness training academy is still operating, preparing for the onslaught of students.", 0);
		add_dialog_str(3, "The instructor and guards in town have started cleaning up the town for the returning citizens.", 0);
		add_dialog_choice(0, "Ok");
		choice = run_dialog(TRUE);
	}
break;

beginstate 10;
	run_scenario_script(12);
break;

beginstate 11;
	if (get_flag(3, 1) == FALSE) {
		set_flag(3, 1, TRUE);
		turn_off_training(FALSE);
	}
break;

beginstate 12;
	if (get_flag(3, 1) > 0) {
		set_flag(3, 1, FALSE);
		turn_off_training(TRUE);
	}
break;

beginstate 13;
break;

beginstate 14;
	run_scenario_script(13);
break;

beginstate 15;
break;

beginstate 16;
	if (get_flag(17, 3) == FALSE) {
		set_flag(17, 3, TRUE);
		message_dialog("The shop, though not yet a shop again, has been cleaned up.",
			"All it needs is someone to move a business into it.");
	}
break;

beginstate 17;
	if (get_flag(17, 4) == FALSE) {
		set_flag(17, 4, TRUE);
		message_dialog("The room is clean and spotless now.", "The guards still stay here until the shop reopens.");
	}
break;

beginstate 18;
	message_dialog("The desk is empty.", "Somebody has started cleaning up around here.");
break;
